package com.ruoyi.system.utils;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import org.springframework.stereotype.Component;

/**
 * Description:
 *
 * @author JourWon
 * @date Created on 2025/5/14
 */
@Component
public class IdGenerator {

    private final Snowflake snowflake;

    public IdGenerator() {
        this.snowflake = IdUtil.getSnowflake(1, 1);
    }

    public long nextId() {
        return snowflake.nextId();
    }
}
